package query

import "ssnotify/common/dto"

type NotifyTemplateGetReq struct {
	dto.Pagination `search:"-"`
	dto.OrderBy
	dto.UserInfo
	Search      string `form:"search" search:"type:contains;column:name;table:sys_notify_template"`
	AliTemplate bool   `form:"aliTemplate" search:"-"`
	Id          string `form:"id" search:"type:exact;column:id;table:sys_notify_template"`

	Type         string   `search:"type:exact;column:type;table:sys_notify_template"`
	IdIn         []string `search:"type:in;column:id;table:sys_notify_template"`
	AgencyIdEq   string   `search:"type:exact;column:agency_id;table:sys_notify_template"`
	AgencyIdLike string   `search:"type:contains;column:agency_id;table:sys_notify_template"`
}

func (m *NotifyTemplateGetReq) GetNeedSearch() interface{} {
	if len(m.UserId) > 0 && m.UserId != "1" {
		//m.AgencyIdEq = m.AgencyId
		m.AgencyIdLike = m.AgencyId
	}
	return *m
}
